﻿#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->label,SIGNAL(Clicked()),this,SLOT(onClicked()));

}

Widget::~Widget()
{
    delete ui;
}

void Widget::onClicked()
{
    QString labeltxt="key pressed";
    if(ui->label->text()!= labeltxt)
    {
        ui->label->setText(labeltxt);
    }
    else
    {
        ui->label->setText("normal status");
    }


    qDebug()<<"clicked!"<<ui->label->text();
}
